import React from 'react'

export interface User {
  id:number,
  name:string

}

export interface SearchProjectType {
  users:User[],
  setParam:(param:SearchProjectType["param"])=>void,
  param:{
    name:string,
    personId:number
  }
}

export default function SearchProject({setParam,users,param}:SearchProjectType) {
  return (
    <div>
      <input type="text" onChange={ (evt)=>{setParam({...param,name:evt.target.value})}} />
      <select name="负责人" onChange={ (evt)=>{ setParam({...param,personId:Number(evt.target.value)})}}>
        <option value="">负责人</option>
        {
          users?.map((user)=>{
            return ( <option value={user.id} key={user.id}>{user.name}</option>)
          })
        }
      </select>
    </div>
  )
}
